<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"alicespace.cn","root":"/","scheme":"Pisces","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="PKU_mcserver设置教程">
<meta property="og:type" content="article">
<meta property="og:title" content="Minecraft服务器配置教程">
<meta property="og:url" content="https://alicespace.cn/2020/03/12/mcserver1/index.html">
<meta property="og:site_name" content="Alicespace">
<meta property="og:description" content="PKU_mcserver设置教程">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://cdn.alicespace.cn/hexo/image-20200131192420702.png">
<meta property="og:image" content="http://cdn.alicespace.cn/hexo/image-20200204192448299.png">
<meta property="article:published_time" content="2020-03-12T08:57:12.000Z">
<meta property="article:modified_time" content="2020-04-13T06:28:00.479Z">
<meta property="article:author" content="Alice_space">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://cdn.alicespace.cn/hexo/image-20200131192420702.png">

<link rel="canonical" href="https://alicespace.cn/2020/03/12/mcserver1/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>Minecraft服务器配置教程 | Alicespace</title>
  


  <script data-pjax>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?6eca0114ff0404ceca2063f195831835";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Alicespace</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Alice空间</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://alicespace.cn/2020/03/12/mcserver1/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="Alice_space">
      <meta itemprop="description" content="既然选择了远方,便只顾风雨兼程">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Alicespace">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          Minecraft服务器配置教程
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2020-03-12 16:57:12" itemprop="dateCreated datePublished" datetime="2020-03-12T16:57:12+08:00">2020-03-12</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-04-13 14:28:00" itemprop="dateModified" datetime="2020-04-13T14:28:00+08:00">2020-04-13</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/minecraft-server/" itemprop="url" rel="index"><span itemprop="name">minecraft server</span></a>
                </span>
            </span>

          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="PKU-mcserver设置教程"><a href="#PKU-mcserver设置教程" class="headerlink" title="PKU_mcserver设置教程"></a>PKU_mcserver设置教程</h1><a id="more"></a>
<h3 id="By-Alice-space"><a href="#By-Alice-space" class="headerlink" title="By Alice_space"></a>By Alice_space</h3><hr>
<h2 id="1-运行环境"><a href="#1-运行环境" class="headerlink" title="1. 运行环境"></a>1. 运行环境</h2><p><strong>推荐运行在Linux系统上，本教程依托于Ubuntu18.04LTS系统</strong><br>需要安装<code>MySQL</code>、<code>Nginx</code>、<code>OpenJDK</code>作为运行环境<br>首先，更新源</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt update</span><br></pre></td></tr></table></figure>
<h3 id="安装OpenJDK"><a href="#安装OpenJDK" class="headerlink" title="安装OpenJDK"></a>安装OpenJDK</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install default-jdk</span><br></pre></td></tr></table></figure>
<p>检查安装</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">java -version</span><br></pre></td></tr></table></figure>
<p>得到输出</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">openjdk version <span class="string">"11.0.6"</span> 2020-01-14</span><br><span class="line">OpenJDK Runtime Environment (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1)</span><br><span class="line">OpenJDK 64-Bit Server VM (build 11.0.6+10-post-Ubuntu-1ubuntu118.04.1, mixed mode, sharing)</span><br></pre></td></tr></table></figure>
<p>java运行环境安装完成</p>
<h3 id="安装MySQL"><a href="#安装MySQL" class="headerlink" title="安装MySQL"></a>安装MySQL</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install mysql-server</span><br></pre></td></tr></table></figure>
<p>进行安全配置</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo mysql_secure_installation</span><br></pre></td></tr></table></figure>
<p>是一段交互式引导</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br></pre></td><td class="code"><pre><span class="line">Securing the MySQL server deployment.</span><br><span class="line"></span><br><span class="line">Connecting to MySQL using a blank password.</span><br><span class="line"></span><br><span class="line">VALIDATE PASSWORD PLUGIN can be used to <span class="built_in">test</span> passwords</span><br><span class="line">and improve security. It checks the strength of password</span><br><span class="line">and allows the users to <span class="built_in">set</span> only those passwords <span class="built_in">which</span> are</span><br><span class="line">secure enough. Would you like to setup VALIDATE PASSWORD plugin?</span><br><span class="line"></span><br><span class="line">Press y|Y <span class="keyword">for</span> Yes, any other key <span class="keyword">for</span> No: y</span><br><span class="line"></span><br><span class="line">There are three levels of password validation policy:</span><br><span class="line"></span><br><span class="line">LOW    Length &gt;= 8</span><br><span class="line">MEDIUM Length &gt;= 8, numeric, mixed <span class="keyword">case</span>, and special characters</span><br><span class="line">STRONG Length &gt;= 8, numeric, mixed <span class="keyword">case</span>, special characters and dictionary                  file</span><br><span class="line"></span><br><span class="line">Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2</span><br><span class="line">Please <span class="built_in">set</span> the password <span class="keyword">for</span> root here.</span><br><span class="line"></span><br><span class="line">New password: <span class="comment"># root密码</span></span><br><span class="line"></span><br><span class="line">Re-enter new password: <span class="comment"># 再次输入</span></span><br><span class="line"></span><br><span class="line">Estimated strength of the password: 100</span><br><span class="line">Do you wish to <span class="built_in">continue</span> with the password provided?(Press y|Y <span class="keyword">for</span> Yes, any other key <span class="keyword">for</span> No) : y <span class="comment"># 确认root密码</span></span><br><span class="line">By default, a MySQL installation has an anonymous user,</span><br><span class="line">allowing anyone to <span class="built_in">log</span> into MySQL without having to have</span><br><span class="line">a user account created <span class="keyword">for</span> them. This is intended only <span class="keyword">for</span></span><br><span class="line">testing, and to make the installation go a bit smoother.</span><br><span class="line">You should remove them before moving into a production</span><br><span class="line">environment.</span><br><span class="line"></span><br><span class="line">Remove anonymous users? (Press y|Y <span class="keyword">for</span> Yes, any other key <span class="keyword">for</span> No) : y</span><br><span class="line">Success. <span class="comment"># 移除匿名用户</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Normally, root should only be allowed to connect from</span><br><span class="line"><span class="string">'localhost'</span>. This ensures that someone cannot guess at</span><br><span class="line">the root password from the network.</span><br><span class="line"></span><br><span class="line">Disallow root login remotely? (Press y|Y <span class="keyword">for</span> Yes, any other key <span class="keyword">for</span> No) : y</span><br><span class="line">Success. <span class="comment">#禁用远程登陆</span></span><br><span class="line"></span><br><span class="line">By default, MySQL comes with a database named <span class="string">'test'</span> that</span><br><span class="line">anyone can access. This is also intended only <span class="keyword">for</span> testing,</span><br><span class="line">and should be removed before moving into a production</span><br><span class="line">environment.</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">Remove <span class="built_in">test</span> database and access to it? (Press y|Y <span class="keyword">for</span> Yes, any other key <span class="keyword">for</span> No) : y</span><br><span class="line"> - Dropping <span class="built_in">test</span> database...</span><br><span class="line">Success.</span><br><span class="line"></span><br><span class="line"> - Removing privileges on <span class="built_in">test</span> database...</span><br><span class="line">Success.</span><br><span class="line"></span><br><span class="line">Reloading the privilege tables will ensure that all changes</span><br><span class="line">made so far will take effect immediately.</span><br><span class="line"></span><br><span class="line">Reload privilege tables now? (Press y|Y <span class="keyword">for</span> Yes, any other key <span class="keyword">for</span> No) : y</span><br><span class="line">Success.</span><br><span class="line"></span><br><span class="line">All <span class="keyword">done</span>!</span><br></pre></td></tr></table></figure>

<p>验证安装</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo systemctl status mysql</span><br></pre></td></tr></table></figure>

<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line">● mysql.service - MySQL Community Server</span><br><span class="line">   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)</span><br><span class="line">   Active: active (running) since Fri 2020-01-31 11:02:17 UTC; 13min ago</span><br><span class="line"> Main PID: 7239 (mysqld)</span><br><span class="line">    Tasks: 29 (<span class="built_in">limit</span>: 4915)</span><br><span class="line">   CGroup: /system.slice/mysql.service</span><br><span class="line">           └─7239 /usr/sbin/mysqld --daemonize --pid-file=/run/mysqld/mysqld.pid</span><br><span class="line"></span><br><span class="line">Jan 31 11:02:17 alice_space systemd[1]: Starting MySQL Community Server...</span><br><span class="line">Jan 31 11:02:17 alice_space systemd[1]: Started MySQL Community Server.</span><br></pre></td></tr></table></figure>

<p>此时会有验证的权限问题，自己百度</p>
<h3 id="安装Nginx"><a href="#安装Nginx" class="headerlink" title="安装Nginx"></a>安装Nginx</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install nginx</span><br></pre></td></tr></table></figure>
<p>出现如下界面即可</p>
<p><img src="http://cdn.alicespace.cn/hexo/image-20200131192420702.png" alt="image-20200131192420702"></p>
<h3 id="调整防火墙"><a href="#调整防火墙" class="headerlink" title="调整防火墙"></a>调整防火墙</h3><p>Ubuntu默认使用<code>ufw</code>作为防火墙</p>
<p>启用防火墙</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo ufw <span class="built_in">enable</span></span><br><span class="line">sudo ufw default deny</span><br></pre></td></tr></table></figure>

<p>以下命令将列出已有的防火墙配置</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo ufw app list</span><br></pre></td></tr></table></figure>
<p>输出</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">Available applications:</span><br><span class="line">  Nginx Full</span><br><span class="line">  Nginx HTTP</span><br><span class="line">  Nginx HTTPS</span><br><span class="line">  OpenSSH</span><br></pre></td></tr></table></figure>
<p>Nginx提供了三个配置文件：</p>
<ul>
<li><strong>Nginx Full</strong>：此配置文件同时打开端口80（正常，未加密的网络流量）和端口443（TLS / SSL加密的流量）</li>
<li><strong>Nginx HTTP</strong>：此配置文件仅打开端口80（正常，未加密的网络流量）</li>
<li><strong>Nginx HTTPS</strong>：此配置文件仅打开端口443（TLS / SSL加密流量）</li>
</ul>
<p>使用</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo ufw allow <span class="string">'Nginx HTTP'</span></span><br></pre></td></tr></table></figure>

<p>验证更改</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo ufw status</span><br></pre></td></tr></table></figure>

<p>输出应包含</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">Status: active</span><br><span class="line"></span><br><span class="line">To                         Action      From</span><br><span class="line">--                         ------      ----</span><br><span class="line">OpenSSH                    ALLOW       Anywhere                  </span><br><span class="line">Nginx HTTP                 ALLOW       Anywhere                  </span><br><span class="line">OpenSSH (v6)               ALLOW       Anywhere (v6)             </span><br><span class="line">Nginx HTTP (v6)            ALLOW       Anywhere (v6)</span><br></pre></td></tr></table></figure>

<p>访问，得到“Welcome to nginx! ”即可</p>
<p>允许链接MySQL</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo ufw allow from 127.0.0.1 to 127.0.0.1 port 3306 proto tcp</span><br></pre></td></tr></table></figure>

<h2 id="2-运行Minecraft-Server"><a href="#2-运行Minecraft-Server" class="headerlink" title="2. 运行Minecraft Server"></a>2. 运行Minecraft Server</h2><h3 id="使用screen命令来保持会话后台运行"><a href="#使用screen命令来保持会话后台运行" class="headerlink" title="使用screen命令来保持会话后台运行"></a>使用<code>screen</code>命令来保持会话后台运行</h3><p>安装<code>screen</code></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install screen</span><br></pre></td></tr></table></figure>
<p>创建会话</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">screen -R &lt;name_of_session&gt;</span><br></pre></td></tr></table></figure>

<p><code>&lt;name_of_session&gt;</code>是会话名称</p>
<p>读取<code>screen</code></p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">screen -r &lt;name_of_session&gt;</span><br></pre></td></tr></table></figure>
<h3 id="服务端结构示意图"><a href="#服务端结构示意图" class="headerlink" title="服务端结构示意图"></a>服务端结构示意图</h3><figure class="highlight plain"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">graph LR</span><br><span class="line">A[WaterFall代理服务端] --&gt; B(Paper服务端lobby)</span><br><span class="line">A --&gt; C(Paper服务端main)</span><br><span class="line">A --&gt; D(Paper服务端pku)</span><br><span class="line">A --&gt; E(Paper服务端old)</span><br></pre></td></tr></table></figure>
<p>配置简介</p>
<table>
<thead>
<tr>
<th>服务端</th>
<th>lobby</th>
<th>main</th>
<th>old</th>
<th>pku</th>
</tr>
</thead>
<tbody><tr>
<td>含义</td>
<td>大厅</td>
<td>主生存世界</td>
<td>旧生存世界</td>
<td>pku校园重建计划</td>
</tr>
<tr>
<td>有下界、末地</td>
<td>否</td>
<td>是</td>
<td>是</td>
<td>否</td>
</tr>
<tr>
<td>游戏模式</td>
<td>生存</td>
<td>生存</td>
<td>创造</td>
<td>创造</td>
</tr>
</tbody></table>
<h3 id="插件列表"><a href="#插件列表" class="headerlink" title="插件列表"></a>插件列表</h3><p><em>选择插件时，注意Waterfall兼容BungeeCord插件，Paper兼容Spigot和Bukkit插件</em></p>
<ul>
<li><strong>Waterfall</strong>: BungeeTabListPlus</li>
<li><strong>lobby</strong>: SkinRestorer、CoreProtect 、InfiniteAnnouncements</li>
<li><strong>main</strong>: SkinRestorer、CoreProtect 、Dynmap 、LuckPerms</li>
<li><strong>pku</strong>: SkinRestorer、CoreProtect 、Dynmap 、worldedit</li>
<li><strong>old</strong>: SkinRestorer、CoreProtect 、Dynmap</li>
</ul>
<h3 id="配置Dynmap（有问题）"><a href="#配置Dynmap（有问题）" class="headerlink" title="配置Dynmap（有问题）"></a>配置Dynmap（有问题）</h3><ul>
<li><strong>MySQL</strong></li>
</ul>
<ol>
<li>打开<code>plugins/dynmap/configuration.txt</code></li>
<li>编辑<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># MySQL DB for map storage (at 'hostname':'port' with flags "flags" in database 'database' using user 'userid' password 'password' and table prefix 'prefix')</span></span><br><span class="line"> <span class="comment">#type: mysql</span></span><br><span class="line"> <span class="comment">#hostname: localhost</span></span><br><span class="line"> <span class="comment">#port: 3306</span></span><br><span class="line"> <span class="comment">#database: dynmap</span></span><br><span class="line"> <span class="comment">#userid: dynmap</span></span><br><span class="line"> <span class="comment">#password: dynmap</span></span><br><span class="line"> <span class="comment">#prefix: ""</span></span><br><span class="line"> <span class="comment">#flags: "?allowReconnect=true"</span></span><br></pre></td></tr></table></figure>
修改成<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># MySQL DB for map storage (at 'hostname':'port' with flags "flags" in database 'database' using user 'userid' password 'password' and table prefix 'prefix')</span></span><br><span class="line">  <span class="attr">type:</span> <span class="string">mysql</span></span><br><span class="line">  <span class="attr">hostname:</span> <span class="string">localhost</span></span><br><span class="line">  <span class="attr">port:</span> <span class="number">3306</span></span><br><span class="line">  <span class="attr">database:</span> <span class="string">dynmap</span></span><br><span class="line">  <span class="attr">userid:</span> <span class="string">root</span></span><br><span class="line">  <span class="attr">password:</span> <span class="string">&lt;password_of_root&gt;</span></span><br><span class="line">  <span class="attr">prefix:</span> <span class="string">"&lt;name_of_world&gt;_"</span></span><br><span class="line">  <span class="comment">#flags: "?allowReconnect=true"</span></span><br></pre></td></tr></table></figure></li>
</ol>
<ul>
<li><strong>Nginx</strong><ol>
<li>安装<code>php-fpm</code>支持php<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo apt install php-fpm php-mysql</span><br></pre></td></tr></table></figure>
此次安装的版本为php7.2</li>
</ol>
</li>
</ul>
<p>修改nginx配置</p>
<figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="attribute">location</span> <span class="regexp">~* \.php$</span> &#123;</span><br><span class="line">   <span class="attribute">fastcgi_pass</span> unix:/run/php/php7.2-fpm.sock;</span><br><span class="line">   <span class="attribute">include</span>         fastcgi_params;</span><br><span class="line">   <span class="attribute">fastcgi_param</span>   SCRIPT_FILENAME    <span class="variable">$document_root</span><span class="variable">$fastcgi_script_name</span>;</span><br><span class="line">   <span class="attribute">fastcgi_param</span>   SCRIPT_NAME        <span class="variable">$fastcgi_script_name</span>;</span><br><span class="line"> &#125;</span><br></pre></td></tr></table></figure>

<p>重启nginx</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo systemctl restart nginx</span><br></pre></td></tr></table></figure>

<p>测试nginx-php工作正常</p>
<p>在nginx工作目录<code>root</code>下写入<code>test.php</code></p>
<figure class="highlight php"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&lt;?php</span> phpinfo(); <span class="meta">?&gt;</span></span><br></pre></td></tr></table></figure>

<p>在浏览器访问之</p>
<p><img src="http://cdn.alicespace.cn/hexo/image-20200204192448299.png" alt="image-20200204192448299"></p>
<p>修改<code>configuration.txt</code></p>
<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># - class: org.dynmap.InternalClientUpdateComponent</span></span><br><span class="line"><span class="comment">#   sendhealth: true</span></span><br><span class="line"><span class="comment">#   sendposition: true</span></span><br><span class="line"><span class="comment">#   allowwebchat: true</span></span><br><span class="line"><span class="comment">#   webchat-interval: 5</span></span><br><span class="line"><span class="comment">#   hidewebchatip: false</span></span><br><span class="line"><span class="comment">#   trustclientname: false</span></span><br><span class="line"><span class="comment">#   includehiddenplayers: false</span></span><br><span class="line"><span class="comment">#   # (optional) if true, color codes in player display names are used</span></span><br><span class="line"><span class="comment">#   use-name-colors: false</span></span><br><span class="line"><span class="comment">#   # (optional) if true, player login IDs will be used for web chat when their IPs match</span></span><br><span class="line"><span class="comment">#   use-player-login-ip: true</span></span><br><span class="line"><span class="comment">#   # (optional) if use-player-login-ip is true, setting this to true will cause chat messages not matching a known player IP to be ignored</span></span><br><span class="line"><span class="comment">#   require-player-login-ip: false</span></span><br><span class="line"><span class="comment">#   # (optional) block player login IDs that are banned from chatting</span></span><br><span class="line"><span class="comment">#   block-banned-player-chat: true</span></span><br><span class="line"><span class="comment">#   # Require login for web-to-server chat (requires login-enabled: true)</span></span><br><span class="line"><span class="comment">#   webchat-requires-login: false</span></span><br><span class="line"><span class="comment">#   # If set to true, users must have dynmap.webchat permission in order to chat</span></span><br><span class="line"><span class="comment">#   webchat-permissions: false</span></span><br><span class="line"><span class="comment">#   # Limit length of single chat messages</span></span><br><span class="line"><span class="comment">#   chatlengthlimit: 256</span></span><br><span class="line"><span class="comment"># #  # Optional - make players hidden when they are inside/underground/in shadows (#=light level: 0=full shadow,15=sky)</span></span><br><span class="line"><span class="comment"># #  hideifshadow: 4</span></span><br><span class="line"><span class="comment"># #  # Optional - make player hidden when they are under cover (#=sky light level,0=underground,15=open to sky)</span></span><br><span class="line"><span class="comment"># #  hideifundercover: 14</span></span><br><span class="line"><span class="comment"># #  # (Optional) if true, players that are crouching/sneaking will be hidden </span></span><br><span class="line"><span class="comment">#   hideifsneaking: false</span></span><br><span class="line"><span class="comment">#   # If true, player positions/status is protected (login with ID with dynmap.playermarkers.seeall permission required for info other than self)</span></span><br><span class="line"><span class="comment">#   protected-player-info: false</span></span><br><span class="line"><span class="comment">#   # If true, hide players with invisibility potion effects active</span></span><br><span class="line"><span class="comment">#   hide-if-invisiblity-potion: true</span></span><br><span class="line"><span class="comment">#   # If true, player names are not shown on map, chat, list</span></span><br><span class="line"><span class="comment">#   hidenames: false</span></span><br><span class="line"><span class="bullet">-</span> <span class="attr">class:</span> <span class="string">org.dynmap.JsonFileClientUpdateComponent</span></span><br><span class="line">  <span class="attr">writeinterval:</span> <span class="number">1</span></span><br><span class="line">  <span class="attr">sendhealth:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">sendposition:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">allowwebchat:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">webchat-interval:</span> <span class="number">5</span></span><br><span class="line">  <span class="attr">hidewebchatip:</span> <span class="literal">false</span></span><br><span class="line">  <span class="attr">includehiddenplayers:</span> <span class="literal">false</span></span><br><span class="line">  <span class="attr">use-name-colors:</span> <span class="literal">false</span></span><br><span class="line">  <span class="attr">use-player-login-ip:</span> <span class="literal">false</span></span><br><span class="line">  <span class="attr">require-player-login-ip:</span> <span class="literal">false</span></span><br><span class="line">  <span class="attr">block-banned-player-chat:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">hideifshadow:</span> <span class="number">0</span></span><br><span class="line">  <span class="attr">hideifundercover:</span> <span class="number">0</span></span><br><span class="line">  <span class="attr">hideifsneaking:</span> <span class="literal">false</span></span><br><span class="line">  <span class="comment"># Require login for web-to-server chat (requires login-enabled: true)</span></span><br><span class="line">  <span class="attr">webchat-requires-login:</span> <span class="literal">false</span></span><br><span class="line">  <span class="comment"># If set to true, users must have dynmap.webchat permission in order to chat</span></span><br><span class="line">  <span class="attr">webchat-permissions:</span> <span class="literal">false</span></span><br><span class="line">  <span class="comment"># Limit length of single chat messages</span></span><br><span class="line">  <span class="attr">chatlengthlimit:</span> <span class="number">256</span></span><br><span class="line">  <span class="attr">hide-if-invisiblity-potion:</span> <span class="literal">true</span></span><br><span class="line">  <span class="attr">hidenames:</span> <span class="literal">false</span></span><br></pre></td></tr></table></figure>

<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># The path where the tile-files are placed.</span></span><br><span class="line"><span class="attr">tilespath:</span> <span class="string">/home/minecraft/minecraft/plugins/dynmap/web/tiles</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># The path where the web-files are located.</span></span><br><span class="line"><span class="attr">webpath:</span> <span class="string">/home/minecraft/minecraft/plugins/dynmap/web</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># The path were the /dynmapexp command exports OBJ ZIP files</span></span><br><span class="line"><span class="attr">exportpath:</span> <span class="string">export</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># The network-interface the webserver will bind to (0.0.0.0 for all interfaces, 127.0.0.1 for only local access).</span></span><br><span class="line"><span class="comment"># If not set, uses same setting as server in server.properties (or 0.0.0.0 if not specified)</span></span><br><span class="line"><span class="comment">#webserver-bindaddress: 0.0.0.0</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># The TCP-port the webserver will listen on.</span></span><br><span class="line"><span class="comment">#webserver-port: 8123</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Maximum concurrent session on internal web server - limits resources used in Bukkit server</span></span><br><span class="line"><span class="comment">#max-sessions: 30</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Disables Webserver portion of Dynmap (Advanced users only)</span></span><br><span class="line"><span class="attr">disable-webserver:</span> <span class="literal">true</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Enable/disable having the web server allow symbolic links (true=compatible with existing code, false=more secure (default))</span></span><br><span class="line"><span class="attr">allow-symlinks:</span> <span class="literal">false</span></span><br></pre></td></tr></table></figure>

<figure class="highlight nginx"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">server</span> &#123;</span><br><span class="line">	<span class="attribute">listen</span> <span class="number">80</span> default_server;</span><br><span class="line">	<span class="attribute">listen</span> [::]:<span class="number">80</span> default_server;</span><br><span class="line"></span><br><span class="line">	<span class="comment"># SSL configuration</span></span><br><span class="line">	<span class="comment">#</span></span><br><span class="line">	<span class="comment"># listen 443 ssl default_server;</span></span><br><span class="line">	<span class="comment"># listen [::]:443 ssl default_server;</span></span><br><span class="line">	<span class="comment">#</span></span><br><span class="line">	<span class="comment"># Note: You should disable gzip for SSL traffic.</span></span><br><span class="line">	<span class="comment"># See: https://bugs.debian.org/773332</span></span><br><span class="line">	<span class="comment">#</span></span><br><span class="line">	<span class="comment"># Read up on ssl_ciphers to ensure a secure configuration.</span></span><br><span class="line">	<span class="comment"># See: https://bugs.debian.org/765782</span></span><br><span class="line">	<span class="comment">#</span></span><br><span class="line">	<span class="comment"># Self signed certs generated by the ssl-cert package</span></span><br><span class="line">	<span class="comment"># Don't use them in a production server!</span></span><br><span class="line">	<span class="comment">#</span></span><br><span class="line">	<span class="comment"># include snippets/snakeoil.conf;</span></span><br><span class="line"></span><br><span class="line">	<span class="attribute">root</span> /var/www/html;</span><br><span class="line"></span><br><span class="line">	<span class="comment"># Add index.php to the list if you are using PHP</span></span><br><span class="line">	<span class="attribute">index</span> index.html index.htm index.nginx-debian.html;</span><br><span class="line"></span><br><span class="line">	<span class="attribute">server_name</span> _;</span><br><span class="line"> 	<span class="attribute">proxy_set_header</span> Host <span class="variable">$host</span>:<span class="variable">$server_port</span>;  </span><br><span class="line">    <span class="attribute">proxy_set_header</span> X-Real-IP <span class="variable">$remote_addr</span>;  </span><br><span class="line">    <span class="attribute">proxy_set_header</span> REMOTE-HOST <span class="variable">$remote_addr</span>;  </span><br><span class="line">    <span class="attribute">proxy_set_header</span> X-Forwarded-For <span class="variable">$proxy_add_x_forwarded_for</span>;</span><br><span class="line">	<span class="attribute">location</span> / &#123;</span><br><span class="line">		<span class="comment"># First attempt to serve request as file, then</span></span><br><span class="line">		<span class="comment"># as directory, then fall back to displaying a 404.</span></span><br><span class="line">		<span class="attribute">try_files</span> <span class="variable">$uri</span> <span class="variable">$uri</span>/ =<span class="number">404</span>;</span><br><span class="line">	&#125;</span><br><span class="line"></span><br><span class="line">	<span class="comment"># pass PHP scripts to FastCGI server</span></span><br><span class="line">	<span class="comment">#</span></span><br><span class="line">	<span class="attribute">location</span> <span class="regexp">~ \.php$</span> &#123;</span><br><span class="line">	<span class="comment">#	include snippets/fastcgi-php.conf;</span></span><br><span class="line">	<span class="comment">#</span></span><br><span class="line">	<span class="comment">#	# With php-fpm (or other unix sockets):</span></span><br><span class="line">		<span class="attribute">fastcgi_pass</span> unix:/var/run/php/php7.2-fpm.sock;</span><br><span class="line">		<span class="attribute">include</span>         fastcgi_params;</span><br><span class="line">    	<span class="attribute">fastcgi_param</span>   SCRIPT_FILENAME    <span class="variable">$document_root</span><span class="variable">$fastcgi_script_name</span>;</span><br><span class="line">   		<span class="attribute">fastcgi_param</span>   SCRIPT_NAME        <span class="variable">$fastcgi_script_name</span>;</span><br><span class="line">		<span class="attribute">try_files</span> <span class="variable">$fastcgi_script_name</span> =<span class="number">404</span>;</span><br><span class="line">		<span class="attribute">gzip</span> <span class="literal">off</span>;</span><br><span class="line">		<span class="attribute">fastcgi_split_path_info</span><span class="regexp"> ^(.+\.php)(/.+)$</span>;</span><br><span class="line">		<span class="attribute">fastcgi_index</span> index.php;</span><br><span class="line">	<span class="comment">#	# With php-cgi (or other tcp sockets):</span></span><br><span class="line">	<span class="comment">#	fastcgi_pass 127.0.0.1:9000;</span></span><br><span class="line">	&#125;</span><br></pre></td></tr></table></figure>

<p>将符号链接添加到www目录</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">ln -s /home/alice/mc/plugins/dynmap/web/ /var/www/html/&lt;name_of_world&gt;/</span><br></pre></td></tr></table></figure>

<p>重启就好</p>
<p>原链接：<a href="https://github.com/webbukkit/dynmap/issues/2027" target="_blank" rel="noopener">https://github.com/webbukkit/dynmap/issues/2027</a></p>
<h3 id="配置-CoreProtect"><a href="#配置-CoreProtect" class="headerlink" title="配置 CoreProtect"></a>配置 CoreProtect</h3><ol>
<li>打开<code>plugins/CoreProtect/config.yml</code></li>
<li>编辑<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># MySQL is optional and not required.</span></span><br><span class="line"><span class="comment"># If you prefer to use MySQL, enable the following and fill out the fields.</span></span><br><span class="line"><span class="attr">use-mysql:</span> <span class="literal">false</span></span><br><span class="line"><span class="attr">table-prefix:</span> <span class="string">co_</span></span><br><span class="line"><span class="attr">mysql-host:</span> <span class="number">127.0</span><span class="number">.0</span><span class="number">.1</span></span><br><span class="line"><span class="attr">mysql-port:</span> <span class="number">3306</span></span><br><span class="line"><span class="attr">mysql-database:</span> <span class="string">co</span></span><br><span class="line"><span class="attr">mysql-username:</span> <span class="string">root</span></span><br><span class="line"><span class="attr">mysql-password:</span></span><br></pre></td></tr></table></figure>
修改为<figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># MySQL is optional and not required.</span></span><br><span class="line"><span class="comment"># If you prefer to use MySQL, enable the following and fill out the fields.</span></span><br><span class="line"><span class="attr">use-mysql:</span> <span class="literal">true</span></span><br><span class="line"><span class="attr">table-prefix:</span> <span class="string">co_&lt;name_of_world&gt;_</span></span><br><span class="line"><span class="attr">mysql-host:</span> <span class="number">127.0</span><span class="number">.0</span><span class="number">.1</span></span><br><span class="line"><span class="attr">mysql-port:</span> <span class="number">3306</span></span><br><span class="line"><span class="attr">mysql-database:</span> <span class="string">co</span></span><br><span class="line"><span class="attr">mysql-username:</span> <span class="string">root</span></span><br><span class="line"><span class="attr">mysql-password:</span> <span class="string">&lt;password_of_root&gt;</span></span><br></pre></td></tr></table></figure>

</li>
</ol>
<h2 id="3-frp反向代理（无公网ip时）"><a href="#3-frp反向代理（无公网ip时）" class="headerlink" title="3. frp反向代理（无公网ip时）"></a>3. frp反向代理（无公网ip时）</h2><p>frp项目GitHub地址:<a href="https://github.com/fatedier/frp/" target="_blank" rel="noopener">https://github.com/fatedier/frp/</a><br>将frpc放在<code>/opt/bin/frpc</code><br>修改</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">vim /opt/etc/frpc.ini</span><br></pre></td></tr></table></figure>
<h3 id="注册为服务"><a href="#注册为服务" class="headerlink" title="注册为服务"></a>注册为服务</h3><p>修改</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sudo vim /etc/systemd/system/frpc.service</span><br></pre></td></tr></table></figure>
<p>按如下修改</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="section">[Unit]</span></span><br><span class="line"><span class="attr">Description</span>=frpc daemon</span><br><span class="line"><span class="attr">After</span>=syslog.target  network.target</span><br><span class="line"><span class="attr">Wants</span>=network.target</span><br><span class="line"></span><br><span class="line"><span class="section">[Service]</span></span><br><span class="line"><span class="attr">Type</span>=simple</span><br><span class="line"><span class="attr">ExecStart</span>=/opt/frpc/frpc -c /opt/frpc/frpc.ini</span><br><span class="line"><span class="attr">Restart</span>= always</span><br><span class="line"><span class="attr">RestartSec</span>=<span class="number">20</span>s</span><br><span class="line"><span class="attr">ExecStop</span>=/usr/bin/killall frpc</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="section">[Install]</span></span><br><span class="line"><span class="attr">WantedBy</span>=multi-user.target</span><br></pre></td></tr></table></figure>
<p>使用</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">sudo systemctl <span class="built_in">enable</span> frpc.service</span><br><span class="line">sudo systemctl start frpc.service</span><br></pre></td></tr></table></figure>
<p>启用服务</p>
<h3 id="转发dynmap"><a href="#转发dynmap" class="headerlink" title="转发dynmap"></a>转发dynmap</h3><p>修改<code>frpc.ini</code></p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># frpc.ini</span></span><br><span class="line"><span class="section">[common]</span></span><br><span class="line"><span class="attr">server_addr</span> = x.x.x.x</span><br><span class="line"><span class="attr">server_port</span> = <span class="number">7000</span></span><br><span class="line"></span><br><span class="line"><span class="section">[web]</span></span><br><span class="line"><span class="attr">type</span> = http</span><br><span class="line"><span class="attr">local_port</span> = <span class="number">80</span></span><br><span class="line"><span class="attr">custom_domains</span> = www.yourdomain.com</span><br></pre></td></tr></table></figure>
<p>修改<code>frps.ini</code></p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># frps.ini</span></span><br><span class="line"><span class="section">[common]</span></span><br><span class="line"><span class="attr">bind_port</span> = <span class="number">7000</span></span><br><span class="line"><span class="attr">vhost_http_port</span> = <span class="number">8080</span></span><br></pre></td></tr></table></figure>

<p>再用nginx代理一下，消除端口就可以了</p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item"></div>
      <div class="post-nav-item">
    <a href="/2020/03/12/dailytalk/" rel="next" title="安慰与被安慰——我们到底需要什么">
      安慰与被安慰——我们到底需要什么 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#PKU-mcserver设置教程"><span class="nav-number">1.</span> <span class="nav-text">PKU_mcserver设置教程</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#By-Alice-space"><span class="nav-number">1.0.1.</span> <span class="nav-text">By Alice_space</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#1-运行环境"><span class="nav-number">1.1.</span> <span class="nav-text">1. 运行环境</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#安装OpenJDK"><span class="nav-number">1.1.1.</span> <span class="nav-text">安装OpenJDK</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装MySQL"><span class="nav-number">1.1.2.</span> <span class="nav-text">安装MySQL</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#安装Nginx"><span class="nav-number">1.1.3.</span> <span class="nav-text">安装Nginx</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#调整防火墙"><span class="nav-number">1.1.4.</span> <span class="nav-text">调整防火墙</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2-运行Minecraft-Server"><span class="nav-number">1.2.</span> <span class="nav-text">2. 运行Minecraft Server</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#使用screen命令来保持会话后台运行"><span class="nav-number">1.2.1.</span> <span class="nav-text">使用screen命令来保持会话后台运行</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#服务端结构示意图"><span class="nav-number">1.2.2.</span> <span class="nav-text">服务端结构示意图</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#插件列表"><span class="nav-number">1.2.3.</span> <span class="nav-text">插件列表</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置Dynmap（有问题）"><span class="nav-number">1.2.4.</span> <span class="nav-text">配置Dynmap（有问题）</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#配置-CoreProtect"><span class="nav-number">1.2.5.</span> <span class="nav-text">配置 CoreProtect</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#3-frp反向代理（无公网ip时）"><span class="nav-number">1.3.</span> <span class="nav-text">3. frp反向代理（无公网ip时）</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#注册为服务"><span class="nav-number">1.3.1.</span> <span class="nav-text">注册为服务</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#转发dynmap"><span class="nav-number">1.3.2.</span> <span class="nav-text">转发dynmap</span></a></li></ol></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">Alice_space</p>
  <div class="site-description" itemprop="description">既然选择了远方,便只顾风雨兼程</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">8</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">5</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
        <span class="site-state-item-count">1</span>
        <span class="site-state-item-name">标签</span>
      </div>
  </nav>
</div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        
  <div class="beian"><a href="http://www.beian.miit.gov.cn/" rel="noopener" target="_blank">京ICP备19045616号-1 </a>
  </div>

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Alice_space</span>
</div>

        








      </div>
    </footer>
  </div>

  
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/pjax/pjax.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/pisces.js"></script>


<script src="/js/next-boot.js"></script>

  <script>
var pjax = new Pjax({
  selectors: [
    'head title',
    '#page-configurations',
    '.content-wrap',
    '.post-toc-wrap',
    '.languages',
    '#pjax'
  ],
  switches: {
    '.post-toc-wrap': Pjax.switches.innerHTML
  },
  analytics: false,
  cacheBust: false,
  scrollTo : !CONFIG.bookmark.enable
});

window.addEventListener('pjax:success', () => {
  document.querySelectorAll('script[data-pjax], script#page-configurations, #pjax script').forEach(element => {
    var code = element.text || element.textContent || element.innerHTML || '';
    var parent = element.parentNode;
    parent.removeChild(element);
    var script = document.createElement('script');
    if (element.id) {
      script.id = element.id;
    }
    if (element.className) {
      script.className = element.className;
    }
    if (element.type) {
      script.type = element.type;
    }
    if (element.src) {
      script.src = element.src;
      // Force synchronous loading of peripheral JS.
      script.async = false;
    }
    if (element.dataset.pjax !== undefined) {
      script.dataset.pjax = '';
    }
    if (code !== '') {
      script.appendChild(document.createTextNode(code));
    }
    parent.appendChild(script);
  });
  NexT.boot.refresh();
  // Define Motion Sequence & Bootstrap Motion.
  if (CONFIG.motion.enable) {
    NexT.motion.integrator
      .init()
      .add(NexT.motion.middleWares.subMenu)
      .add(NexT.motion.middleWares.postList)
      .bootstrap();
  }
  NexT.utils.updateSidebarPosition();
});
</script>




  















    <div id="pjax">
  

  

    </div>
<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","lagMode":false,"log":false,"model":{"jsonPath":"/live2dw/assets/hijiki.model.json"},"display":{"position":"right","width":200,"height":300},"mobile":{"show":false},"react":{"opacity":0.9},"tagMode":false});</script></body>
</html>
